package com.cskaoyan.mapper;

import com.cskaoyan.bean.bo.goodsbo.GoodsBO;
import com.cskaoyan.bean.po.MarketGoods;
import com.cskaoyan.bean.po.MarketGoodsExample;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface MarketGoodsMapper {
    long countByExample(MarketGoodsExample example);

    int deleteByExample(MarketGoodsExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(MarketGoods record);

    int insertSelective(MarketGoods record);

    List<MarketGoods> selectByExampleWithBLOBs(MarketGoodsExample example);

    List<MarketGoods> selectByExample(MarketGoodsExample example);

    MarketGoods selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") MarketGoods record, @Param("example") MarketGoodsExample example);

    int updateByExampleWithBLOBs(@Param("record") MarketGoods record, @Param("example") MarketGoodsExample example);

    int updateByExample(@Param("record") MarketGoods record, @Param("example") MarketGoodsExample example);

    int updateByPrimaryKeySelective(MarketGoods record);

    int updateByPrimaryKeyWithBLOBs(MarketGoods record);

    int updateByPrimaryKey(MarketGoods record);

    // 逻辑删除商品;
    void updategoodsDelete(Integer goodsId);

    // 添加商品
    void insertGoods(@Param("goods") GoodsBO goods, @Param("gallerys") String gallerys);

    Date getAddtime(Integer id);

    List<MarketGoods> selectNewGoods(@Param("newLimit") Integer newLimit, @Param("isNew") boolean isNew);


    List<MarketGoods> selectHotGoods(@Param("hotLimit") Integer hotLimit, @Param("isHot") boolean isHot);

    List<MarketGoods> selectFloorGoods(@Param("logGoodsLimit2") Integer logGoodsLimit2, @Param("ids") List<Integer> ids);

    List<MarketGoods> selectGoodsByCateId(Integer categoryId);

    String selectShareUrl(Integer id);

    Integer selectGoodsCateId(Integer id);

    List<MarketGoods> selectGoodsByCateIdLimit(@Param("cateId") Integer cateId, @Param("limit") Integer limit);

    List<MarketGoods> selectGoodsByBrandId(Integer brandId);
}